// 联合类型: 所有字段共享相同的内存空间。为了与C代码交互，直接映射了 C 语言的 union
#[repr(C)]
union Metric {
    rounded: u32,
    precise: f32
}

fn main() {
    let mut a = Metric { rounded: 323};
    unsafe { println!("{}", a.rounded); }
    unsafe { println!("{}", a.precise); }
    a.precise = 33.3;
    unsafe { println!("{}", a.precise); }
    unsafe { println!("{}", a.rounded); }
}